/*
 * @Author: 无聊 7989314+Hwz1997@user.noreply.gitee.com
 * @Date: 2025-07-01 18:00:58
 * @LastEditors: 无聊 7989314+Hwz1997@user.noreply.gitee.com
 * @LastEditTime: 2025-09-18 09:39:27
 * @FilePath: \keep_motion_api\utils\model-mapping.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// utils/model-mapping.js
const modelMapping = {
  user_avatar: {
    model: 'User',
    path: '/uploads/avatars/',
    maxSize: 2 // MB
  },
  course_image: {
    model: 'Course',
    path: '/uploads/courses/images/',
    maxSize: 5
  },
  course_video: {
    model: 'Course',
    path: '/uploads/courses/videos/',
    maxSize: 1024 // 1GB
  },
  course_resource: {
    model: 'Course',
    path: '/uploads/courses/resources/',
    maxSize: 100
  },
  product_image: {
    model: 'Product',
    path: '/uploads/products/',
    maxSize: 10
  },
  promotion_banner: {
    model: 'ProductActivity',
    path: '/uploads/promotions/banners/',
    maxSize: 5
  },
  community_post: {
    model: 'CommunityPost',
    path: '/uploads/community/',
    maxSize: 10
  },
  sport_type_icon: {
    model: 'SportType',
    path: '/uploads/sports/icons/',
    maxSize: 1
  },
  menu_icon: {
    model: 'Menu',
    path: '/uploads/menu/icons/',
    maxSize: 1
  },
  health_assessment: {
    model: 'HealthAssess',
    path: '/uploads/health/',
    maxSize: 10
  },
  activity_cover: {
    model: 'Activity',
    path: '/uploads/activities/',
    maxSize: 5
  },
  diet_record: {
    model: 'DietRecord',
    path: '/uploads/diet/',
    maxSize: 5
  },
  system_config: {
    model: 'SystemConfig',
    path: '/uploads/system/',
    maxSize: 2
  }
};

// 导出枚举值和模型映射
module.exports = {
  fileModules: Object.keys(modelMapping),
  getModel: (module) => modelMapping[module]?.model || null,
  getConfig: (module) => modelMapping[module] || null,
  validateModule: (module) => Object.keys(modelMapping).includes(module)
};